/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.financial.store;

import java.sql.SQLException;
import java.sql.Date;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.jdbc.OracleTypes;
import queenb.net.datacontrol.DataStatement;
import queenb.net.datacontrol.Param;
import queenb.net.entitybean.N100;

import queenb.net.entitybean.T950;
import queenb.web.financial.inteface.FinancialInf;

import queenb.web.util.PackageContants;

/**
 *
 * @author Nguyen Hung
 */
public class FinancialStore extends T950 implements FinancialInf {

    @Override
    public int updateT950(int pnPT950, int pnFH075, int pnFT000,
            double pnTN951, String pvTV952, Date pdTD953, Date pdTD954,
            String pvTV955, String pvTV956, String pvTV957, String pvTV958,
            int pnTN959, String pvTV969, String pvTV970, String pvTV971, int pnFV500,
            int pnFV650, int pnFB050, int pnFT900, int pnFT075, int pnPN100T, int pnFH000, int pnFT950, String pvLOGIN) {
        try {
            DataStatement updateStatement = new DataStatement(PackageContants.UPDATE_T950, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnPT950),
                        new Param(OracleTypes.INTEGER, pnFH075),
                        new Param(OracleTypes.INTEGER, pnFT000),
                        new Param(OracleTypes.DOUBLE, pnTN951),
                        new Param(OracleTypes.CHAR, pvTV952),
                        new Param(OracleTypes.DATE, pdTD953),
                        new Param(OracleTypes.DATE, pdTD954),
                        new Param(OracleTypes.CHAR, pvTV955),
                        new Param(OracleTypes.CHAR, pvTV956),
                        new Param(OracleTypes.CHAR, pvTV957),
                        new Param(OracleTypes.CHAR, pvTV958),
                        new Param(OracleTypes.INTEGER, pnTN959),
                        new Param(OracleTypes.CHAR, pvTV969),
                        new Param(OracleTypes.CHAR, pvTV970),
                        new Param(OracleTypes.CHAR, pvTV971),
                        new Param(OracleTypes.INTEGER, pnFV500),
                        new Param(OracleTypes.INTEGER, pnFV650),
                        new Param(OracleTypes.INTEGER, pnFB050),
                        new Param(OracleTypes.INTEGER, pnFT900),
                        new Param(OracleTypes.INTEGER, pnFT075),
                        new Param(OracleTypes.INTEGER, pnPN100T),
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFT950),
                        new Param(OracleTypes.CHAR, pvLOGIN)});
            return super.update(updateStatement, T950.class);
        } catch (SQLException ex) {
            Logger.getLogger(FinancialStore.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }

    @Override
    public int deleteT950(int pnPT950, String pvTV968, String pvLOGIN) {
        DataStatement dataStatement = new DataStatement(PackageContants.DELETE_T950, OracleTypes.INTEGER, new Param[]{
                    new Param(OracleTypes.INTEGER, pnPT950),
                    new Param(OracleTypes.CHAR, pvTV968),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });
        try {
            return super.update(dataStatement, T950.class);
        } catch (SQLException ex) {
            Logger.getLogger(FinancialStore.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }

    @Override
    public int ConfirmT950(int pnPT950, String pvLOGIN) {
        DataStatement dataStatement = new DataStatement(PackageContants.CONFIRM_T950, OracleTypes.INTEGER, new Param[]{
                    new Param(OracleTypes.INTEGER, pnPT950),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });
        try {
            return super.update(dataStatement, T950.class);
        } catch (SQLException ex) {
            Logger.getLogger(FinancialStore.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }

    @Override
    public int approveT950(int pnPT950, String pvLOGIN) {
        DataStatement dataStatement = new DataStatement(PackageContants.APPROVE_T950, OracleTypes.INTEGER, new Param[]{
                    new Param(OracleTypes.INTEGER, pnPT950),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });
        try {
            return super.update(dataStatement, T950.class);
        } catch (SQLException ex) {
            Logger.getLogger(FinancialStore.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }

    @Override
    public List<T950> listT950(int pnFH000, int pnFH200, int pnFH075, int pnFT000,
            int pnFB050, int pnFV500, int pnFT900, int pnOFFSET, int pnLIMIT, int pnSORT,
            int pnDIRECT, String pvLOGIN) {
        try {
            DataStatement dataStatement = new DataStatement(PackageContants.LIST_T950, OracleTypes.CURSOR, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.INTEGER, pnFH075),
                        new Param(OracleTypes.INTEGER, pnFT000),
                        new Param(OracleTypes.INTEGER, pnFB050),
                        new Param(OracleTypes.INTEGER, pnFV500),
                        new Param(OracleTypes.INTEGER, pnFT900),
                        new Param(OracleTypes.INTEGER, pnOFFSET),
                        new Param(OracleTypes.INTEGER, pnLIMIT),
                        new Param(OracleTypes.INTEGER, pnSORT),
                        new Param(OracleTypes.INTEGER, pnDIRECT),
                        new Param(OracleTypes.CHAR, pvLOGIN)});

            return super.find(dataStatement, T950.class);
        } catch (SQLException ex) {
            Logger.getLogger(FinancialStore.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(FinancialStore.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(FinancialStore.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    @Override
    public List<T950> listT950CN(int pnFH000, int pnFH200, int pnFH075, int pnFT000, int pnFB050, int pnFV500, int pnFT950, int pnOFFSET, int pnLIMIT, int pnSORT, int pnDIRECT, String pvLOGIN) {
        try {
            DataStatement dataStatement = new DataStatement(PackageContants.LIST_T950CN, OracleTypes.CURSOR, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.INTEGER, pnFH075),
                        new Param(OracleTypes.INTEGER, pnFT000),
                        new Param(OracleTypes.INTEGER, pnFB050),
                        new Param(OracleTypes.INTEGER, pnFV500),
                        new Param(OracleTypes.INTEGER, pnFT950),
                        new Param(OracleTypes.INTEGER, pnOFFSET),
                        new Param(OracleTypes.INTEGER, pnLIMIT),
                        new Param(OracleTypes.INTEGER, pnSORT),
                        new Param(OracleTypes.INTEGER, pnDIRECT),
                        new Param(OracleTypes.CHAR, pvLOGIN)});

            return super.find(dataStatement, T950.class);
        } catch (SQLException ex) {
            Logger.getLogger(FinancialStore.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(FinancialStore.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(FinancialStore.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    @Override
    public List<T950> listT950CNAdd(int pnFH000, int pnFH200, int pnFT950, String pvLOGIN) {
        try {
            DataStatement dataStatement = new DataStatement(PackageContants.LIST_T950CNL, OracleTypes.CURSOR, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.INTEGER, pnFT950),
                        new Param(OracleTypes.CHAR, pvLOGIN)});

            return super.find(dataStatement, T950.class);
        } catch (SQLException ex) {
            Logger.getLogger(FinancialStore.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(FinancialStore.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(FinancialStore.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    @Override
    public List<T950> listT950CNH(int pnFH000, int pnFH200, int pnFH075, int pnFT000, int pnFN100, int pnFV500, int pnFT950, int pnOFFSET, int pnLIMIT, int pnSORT, int pnDIRECT, String pvLOGIN) {
        try {
            DataStatement dataStatement = new DataStatement(PackageContants.LIST_T950CNH, OracleTypes.CURSOR, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.INTEGER, pnFH075),
                        new Param(OracleTypes.INTEGER, pnFT000),
                        new Param(OracleTypes.INTEGER, pnFN100),
                        new Param(OracleTypes.INTEGER, pnFV500),
                        new Param(OracleTypes.INTEGER, pnFT950),
                        new Param(OracleTypes.INTEGER, pnOFFSET),
                        new Param(OracleTypes.INTEGER, pnLIMIT),
                        new Param(OracleTypes.INTEGER, pnSORT),
                        new Param(OracleTypes.INTEGER, pnDIRECT),
                        new Param(OracleTypes.CHAR, pvLOGIN)});

            return super.find(dataStatement, T950.class);
        } catch (SQLException ex) {
            Logger.getLogger(FinancialStore.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(FinancialStore.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(FinancialStore.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    @Override
    public List<T950> listT950CNforTour(int pnFH000, int pnFH200, int pnFT000, int pnFV050, int pnFN100, int pnFT950, int pnOFFSET, int pnLIMIT, int pnSORT, int pnDIRECT, String pvLOGIN) {
        try {
            DataStatement dataStatement = new DataStatement(PackageContants.tcurpks_listoftabt950t, OracleTypes.CURSOR, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.INTEGER, pnFT000),
                        new Param(OracleTypes.INTEGER, pnFV050),
                        new Param(OracleTypes.INTEGER, pnFN100),
                        new Param(OracleTypes.INTEGER, pnFT950),
                        new Param(OracleTypes.INTEGER, pnOFFSET),
                        new Param(OracleTypes.INTEGER, pnLIMIT),
                        new Param(OracleTypes.INTEGER, pnSORT),
                        new Param(OracleTypes.INTEGER, pnDIRECT),
                        new Param(OracleTypes.CHAR, pvLOGIN)});

            return super.find(dataStatement, T950.class);
        } catch (SQLException ex) {
            Logger.getLogger(FinancialStore.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(FinancialStore.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(FinancialStore.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    @Override
    public List<T950> listT950CNforTournew(int pnFH000, int pnFH200, int pnFH075, int pnFT000, int pnFK100, int pnFV050, int pnFT950, int pnFQ100, int pnOFFSET, int pnLIMIT, int pnSORT, int pnDIRECT, String pvLOGIN) {
        try {
            DataStatement dataStatement = new DataStatement(PackageContants.tcurpks_listoftabt950new, OracleTypes.CURSOR, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.INTEGER, pnFH075),
                        new Param(OracleTypes.INTEGER, pnFT000),
                        new Param(OracleTypes.INTEGER, pnFK100),
                        new Param(OracleTypes.INTEGER, pnFV050),
                        new Param(OracleTypes.INTEGER, pnFT950),
                        new Param(OracleTypes.INTEGER, pnFQ100),
                        new Param(OracleTypes.INTEGER, pnOFFSET),
                        new Param(OracleTypes.INTEGER, pnLIMIT),
                        new Param(OracleTypes.INTEGER, pnSORT),
                        new Param(OracleTypes.INTEGER, pnDIRECT),
                        new Param(OracleTypes.CHAR, pvLOGIN)});

            return super.find(dataStatement, T950.class);
        } catch (SQLException ex) {
            Logger.getLogger(FinancialStore.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(FinancialStore.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(FinancialStore.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    @Override
    public int stdt_tools_updatetabt950dis(int pnPT950, double pnTN972, double pnTN973, int pnFN100, int pnFH200, int pnFH000, String pvLOGIN) {
        DataStatement dataStatement = new DataStatement(PackageContants.stdt_tools_updatetabt950dis, OracleTypes.INTEGER, new Param[]{
                    new Param(OracleTypes.INTEGER, pnPT950),
                    new Param(OracleTypes.DOUBLE, pnTN972),
                    new Param(OracleTypes.DOUBLE, pnTN973),
                    new Param(OracleTypes.INTEGER, pnFN100),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });
        try {
            return super.update(dataStatement, T950.class);
        } catch (SQLException ex) {
            Logger.getLogger(FinancialStore.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }

    @Override
    public List<T950> tcurpks_listoftabt950child(int pnFH000, int pnFH200, int pnPT950, String pvLOGIN) {
        try {
            DataStatement dataStatement = new DataStatement(PackageContants.tcurpks_listoftabt950child, OracleTypes.CURSOR, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.INTEGER, pnPT950),
                        new Param(OracleTypes.CHAR, pvLOGIN)});

            return super.find(dataStatement, T950.class);
        } catch (SQLException ex) {
            Logger.getLogger(FinancialStore.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(FinancialStore.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(FinancialStore.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }
}
